import Vue from 'vue'
import Vuex from 'vuex'

import { api, $api } from './api'

var remote = true
const HOST=remote?"http://weixin.nmict.cn:8090":"http://localhost:8090"


Vue.use(Vuex)

const main = {
  state: {
    remote:remote,
    host:HOST
  },
  mutations: {
    
  },
  actions: {
    orderAdd(context, payload) {
      return api(`${HOST}/api/order`,{type:'post',params:payload});
    },
    cities(context, payload) {
      return api(`${HOST}/api/cities`);
    }
  }
}



const store = new Vuex.Store({
  modules: {
    main
  }
})

export default store